package com.teamclub.app.scontrollers.systemmanager

import com.teamclub.app.sforms.AppFuncTreeForm
import com.teamclub.app.sservices.systemmanager.AppFuncTreeService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation._

/**
  * Created by ilkkzm on 17-8-9.
  */
@RestController("com.teamclub.app.scontrollers.systemmanager.AppFuncTreeController")
@RequestMapping(Array("/app/systemmanager"))
class AppFuncTreeController {
  @Autowired
  var appFuncTreeService: AppFuncTreeService = _

  @PostMapping(Array("functreelist"))
  def list(@RequestBody form: AppFuncTreeForm) = {
    Eithers.toJson(appFuncTreeService.list(form))
  }

  @PostMapping(Array("functreeadd"))
  def add(@RequestBody form: AppFuncTreeForm) = {
    Eithers.toJson(appFuncTreeService.add(form))
  }

  @PostMapping(Array("functreedel"))
  def del(@RequestBody form: AppFuncTreeForm) = {
    Eithers.toJson(appFuncTreeService.del(form))
  }
}
